<!-- this is post id <%= post.id %> -->

<h1><a href="<%= Site.permalink(post) %>" rel="bookmark" title="<%= post.title %>"><%= post.title %></a></h1>
<div class="descr">
	Posted: <%= post.created_at.strftime(Site.date_format) %> <%= post.created_at.strftime(Site.time_format) %> by <%= author_info(post) %><br/>
	Comments: <%= comment_info(post) %>, Tags: <%= tag_info(post) %>
</div>

<%= post.body %>
<%= extended_content_block(post) %>

<div class="navigation">
	<div class="alignleft"><%= previous_post = Post.find_previous(post).first and link_to('&laquo; Previous Entries', Site.permalink(previous_post)) %></div>
	<div class="alignright"><%= next_post = Post.find_next(post).first and link_to('Next Entries &raquo;', Site.permalink(next_post)) %></div>
</div>

<%# ##################################################### -%>
<%# This is the logic/code for comments... you can copy   -%>
<%# this and use it in your themes to support comments    -%>
<%# ##################################################### -%>
<% if Site.comment_system_on -%>
	<div id="ajax_comments">
		<% if post.comments.length > 0 -%>
			<h3 id="comments"><%= case post.comments.length when 0: 'No Responses' when 1: 'One Response' else "#{post.comments.length} Responses" end %> to &#8220;<%= post.title %>&#8221;</h3>
			<ol class="commentlist">
				<% post.comments.each do |comment| -%>
					<li id="comment-<%= comment.id %>">
						<cite><%= comment.name != '' ? comment_author(comment) : "Anonymous" %></cite> says:<br/>
						<small class="commentmetadata"><a href="#comment-<%= comment.id %>" title="Permalink for this comment"><%= comment.created_at.strftime(Site.date_format) %> at <%= comment.created_at.strftime(Site.time_format) %></a></small>
						<%= comment.body %>
					</li>
				<% end -%>
			</ol>
		<% elsif not accepting_comments(post) -%>
			<p class="nocomments">Comments are closed.</p>
		<% end -%>
	</div>
  <% if accepting_comments(post) -%>
		<h3 id="respond">Leave a Reply</h3>

		<% if flash[:notice] -%>
			<div class="approval_required"><%= flash[:notice] %></div>
		<% end -%>

    <% form_tag(Site.full_url + '/comments/add', :id => 'commentform') do %>
	    <%= hidden_field_tag 'do', '1' %>
	    <%# ###################################################### -%>
	    <%# This is used to check if commenter is human by seeing  -%>
	    <%# if they actually input text into any of the boxes and  -%>
	    <%# requires the additional :onclick and :onkeypress below -%>
	    <%# ###################################################### -%>
	    <%= hidden_field_tag 'human_check', '0' %>
	    <%= hidden_field_tag 'return_url', Post.permalink(post) %>
	    <%= hidden_field_tag 'link', post.permalink %>
	    <%= hidden_field 'comment', 'post_id', :value => post.id.to_s %>
	    <%  temp_repair = error_messages_for('comment', :header_tag => 'h4') || '' %>
	    <%= temp_repair.gsub('Body raw', 'Body') %>
			<p><%= text_field 'comment', 'name', :size => 22, :tabindex => 1 %>
				<label for="comment_name"><small>Name</small></label></p>
			<p><%= text_field 'comment', 'email', :size => 22, :tabindex => 2 %>
				<label for="comment_email"><small>Mail (required - will not be published)</small></label></p>
			<p><%= text_field 'comment', 'url', :size => 22, :tabindex => (index = 3) %>
				<label for="comment_url"><small>Website</small></label></p>
			<% if Site.allow_comment_subjects -%>
				<p><%= text_field 'comment', 'subject', :size => 22, :tabindex => (index += 1) %>
					<label for="comment_subject"><small>Subject</small></label></p>
			<% end -%>
			<p><%= text_area 'comment', 'body_raw', :rows => 10, :cols => 50, :tabindex => (index += 1), :wrap => 'virtual', :onkeypress => "this.form.elements['human_check'].value = '8'" %></p>
      <p><%= submit_tag 'Submit comment', :id => 'submit', :tabindex => (index += 1), :onclick => "this.form.elements['human_check'].value = '8'" %></p>
		<% end -%>
	<% end -%>
<% end -%>
<%# ##################################################### -%>
<%# This is the end of the comment logic block            -%>
<%# ##################################################### -%>

<!-- end post id <%= post.id %> -->